export const setTitle = function(state, params) {
	state.title = params
}

export const setShowCloseBtn = function(state, params) {
	state.showCloseBtn = params
}

export const showToast = function(state, payload) {
	state.toast.isShow = true;
	state.toast.text = payload.text;
	state.toast.type = payload.type;
	state.toast.duration = payload.duration || 1500;
}

export const hideToast = function(state) {
	state.toast.isShow = false;
}

export const showLoading = function(state, payload) {
	clearTimeout(window.loadingTimer)
	window.loadingTimer = setTimeout(() => {
		state.loading.isShow = true;
		state.loading.text = payload || '数据加载中';
	}, 600)
}

export const hideLoading = function(state) {
	clearTimeout(window.loadingTimer)
	state.loading.isShow = false;
	state.loading.text = '';
}